#include "mainwindow.h"
#include <QPushButton>
#include <QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    setFixedSize(400, 300);
    QPushButton *btn = new QPushButton("关闭", this);
    btn->setFixedSize(100, 30);
    // 连接信号与槽
    connect(btn, &QPushButton::clicked,
            this, &QWidget::close);
}

MainWindow::~MainWindow()
{
}

